<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<title>Class: tinyMCEPopup</title>
<meta name="generator" content="MoxieDoc" />

<link rel="stylesheet" type="text/css" href="css/reset.css" />
<link rel="stylesheet" type="text/css" href="css/grids.css" />
<link rel="stylesheet" type="text/css" href="css/general.css" />

<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
	google.load("jquery", "1.3");
</script>
<script type="text/javascript" src="js/jquery.treeview.min.js"></script>
<script type="text/javascript" src="js/general.js"></script>
</head>
<body>
<div class="classDetailsContent">
<h1>tinyMCEPopup</h1>
<table class="classDetails">
<tr>
<td class="first">Class</td>
<td class="last">tinyMCEPopup</td>
</tr>
<tr>
<td class="first">Type</td>
<td class="last">Singleton</td>
</tr>
</table>
<div class="classDescription">TinyMCE popup/dialog helper class. This gives you easy access to the
parent editor instance and a bunch of other things. It's higly recommended
that you load this script into your dialogs.
</div>
<div class="summaryLists">
<h2>Public Methods</h2>
<table class="Methods summary">
<thead>
<tr>
<th>Method</th>
<th>Defined By</th>
</tr>
</thead>
<tbody>
<tr>
<td class="first">
<div>
<a class="memberName" href="class_tinyMCEPopup.html#alert">alert</a>(t:String, cb:function, s:Object):void</div>
<div class="summary">
<span class="static">[static] </span>Creates a alert dialog.</div>
</td>
<td class="last">tinyMCEPopup</td>
</tr>
<tr class="even">
<td class="first">
<div>
<a class="memberName" href="class_tinyMCEPopup.html#close">close</a>():void</div>
<div class="summary">
<span class="static">[static] </span>Closes the current window.</div>
</td>
<td class="last">tinyMCEPopup</td>
</tr>
<tr>
<td class="first">
<div>
<a class="memberName" href="class_tinyMCEPopup.html#confirm">confirm</a>(t:String, cb:function, s:Object):void</div>
<div class="summary">
<span class="static">[static] </span>Creates a confirm dialog.</div>
</td>
<td class="last">tinyMCEPopup</td>
</tr>
<tr class="even">
<td class="first">
<div>
<a class="memberName" href="class_tinyMCEPopup.html#execCommand">execCommand</a>(cmd:String, ui:Boolean, val:Object, a:Object):void</div>
<div class="summary">
<span class="static">[static] </span>Executed a command on editor that opened the dialog/popup.</div>
</td>
<td class="last">tinyMCEPopup</td>
</tr>
<tr>
<td class="first">
<div>
<a class="memberName" href="class_tinyMCEPopup.html#executeOnLoad">executeOnLoad</a>(s:String):void</div>
<div class="summary">
<span class="static">[static] </span>Will executed the specified string when the page has been loaded.</div>
</td>
<td class="last">tinyMCEPopup</td>
</tr>
<tr class="even">
<td class="first">
<div>
<a class="memberName" href="class_tinyMCEPopup.html#getLang">getLang</a>(n:String, dv:String):String</div>
<div class="summary">
<span class="static">[static] </span>Returns a language item by key.</div>
</td>
<td class="last">tinyMCEPopup</td>
</tr>
<tr>
<td class="first">
<div>
<a class="memberName" href="class_tinyMCEPopup.html#getParam">getParam</a>(n:String, dv:String):String</div>
<div class="summary">
<span class="static">[static] </span>Returns a editor parameter/config option value.</div>
</td>
<td class="last">tinyMCEPopup</td>
</tr>
<tr class="even">
<td class="first">
<div>
<a class="memberName" href="class_tinyMCEPopup.html#getWin">getWin</a>():Window</div>
<div class="summary">
<span class="static">[static] </span>Returns the reference to the parent window that opened the dialog.</div>
</td>
<td class="last">tinyMCEPopup</td>
</tr>
<tr>
<td class="first">
<div>
<a class="memberName" href="class_tinyMCEPopup.html#getWindowArg">getWindowArg</a>(n:String, dv:String):String</div>
<div class="summary">
<span class="static">[static] </span>Returns a window argument/parameter by name.</div>
</td>
<td class="last">tinyMCEPopup</td>
</tr>
<tr class="even">
<td class="first">
<div>
<a class="memberName" href="class_tinyMCEPopup.html#init">init</a>():void</div>
<div class="summary">
<span class="static">[static] </span>Initializes the popup this will be called automatically.</div>
</td>
<td class="last">tinyMCEPopup</td>
</tr>
<tr>
<td class="first">
<div>
<a class="memberName" href="class_tinyMCEPopup.html#openBrowser">openBrowser</a>(element_id:string, type:string, option:string):void</div>
<div class="summary">
<span class="static">[static] </span>Opens a filebrowser/imagebrowser this will set the output value from the browser as a value on the specified element.</div>
</td>
<td class="last">tinyMCEPopup</td>
</tr>
<tr class="even">
<td class="first">
<div>
<a class="memberName" href="class_tinyMCEPopup.html#pickColor">pickColor</a>(e:DOMEvent, element_id:string):void</div>
<div class="summary">
<span class="static">[static] </span>Executes a color picker on the specified element id.</div>
</td>
<td class="last">tinyMCEPopup</td>
</tr>
<tr>
<td class="first">
<div>
<a class="memberName" href="class_tinyMCEPopup.html#requireLangPack">requireLangPack</a>():void</div>
<div class="summary">
<span class="static">[static] </span>Loads a specific dialog language pack.</div>
</td>
<td class="last">tinyMCEPopup</td>
</tr>
<tr class="even">
<td class="first">
<div>
<a class="memberName" href="class_tinyMCEPopup.html#resizeToInnerSize">resizeToInnerSize</a>():void</div>
<div class="summary">
<span class="static">[static] </span>Resizes the dialog to the inner size of the window.</div>
</td>
<td class="last">tinyMCEPopup</td>
</tr>
<tr>
<td class="first">
<div>
<a class="memberName" href="class_tinyMCEPopup.html#restoreSelection">restoreSelection</a>():void</div>
<div class="summary">
<span class="static">[static] </span>Restores any stored selection.</div>
</td>
<td class="last">tinyMCEPopup</td>
</tr>
<tr class="even">
<td class="first">
<div>
<a class="memberName" href="class_tinyMCEPopup.html#storeSelection">storeSelection</a>():void</div>
<div class="summary">
<span class="static">[static] </span>Stores the current editor selection for later restoration.</div>
</td>
<td class="last">tinyMCEPopup</td>
</tr>
</tbody>
</table>
<h2>Public Events</h2>
<table class="Events summary">
<thead>
<tr>
<th>Event</th>
<th>Defined By</th>
</tr>
</thead>
<tbody>
<tr>
<td class="first">
<div>
<a class="memberName" href="class_tinyMCEPopup.html#onInit">onInit</a>(editor:<a href="class_tinymce.Editor.html">Editor</a>)</div>
<div class="summary">
<span class="static">[static] </span>Fires when the popup is initialized.</div>
</td>
<td class="last">tinyMCEPopup</td>
</tr>
</tbody>
</table>
</div>
<div class="detailsList">
<div class="details">
<h2>Method details</h2>
<div class="memberDetails" id="alert">
<h3>alert<span class="memberType">method</span>
</h3>
<code class="syntax">public static 
						function alert(t:String, cb:function, s:Object):void</code>
<div class="memberDescription">Creates a alert dialog. Please don't use the blocking behavior of this
native version use the callback method instead then it can be extended.
</div>
<h4>Parameters</h4>
<table class="params">
<tr>
<td class="first">t:String</td>
<td class="last">Title for the new alert dialog.</td>
</tr>
<tr>
<td class="first">cb:function</td>
<td class="last">Callback function to be executed after the user has selected ok.</td>
</tr>
<tr>
<td class="first">s:Object</td>
<td class="last">Optional scope to execute the callback in.</td>
</tr>
</table>
</div>
<div class="memberDetails" id="close">
<h3>close<span class="memberType">method</span>
</h3>
<code class="syntax">public static 
						function close():void</code>
<div class="memberDescription">Closes the current window.
</div>
</div>
<div class="memberDetails" id="confirm">
<h3>confirm<span class="memberType">method</span>
</h3>
<code class="syntax">public static 
						function confirm(t:String, cb:function, s:Object):void</code>
<div class="memberDescription">Creates a confirm dialog. Please don't use the blocking behavior of this
native version use the callback method instead then it can be extended.
</div>
<h4>Parameters</h4>
<table class="params">
<tr>
<td class="first">t:String</td>
<td class="last">Title for the new confirm dialog.</td>
</tr>
<tr>
<td class="first">cb:function</td>
<td class="last">Callback function to be executed after the user has selected ok or cancel.</td>
</tr>
<tr>
<td class="first">s:Object</td>
<td class="last">Optional scope to execute the callback in.</td>
</tr>
</table>
</div>
<div class="memberDetails" id="execCommand">
<h3>execCommand<span class="memberType">method</span>
</h3>
<code class="syntax">public static 
						function execCommand(cmd:String, ui:Boolean, val:Object, a:Object):void</code>
<div class="memberDescription">Executed a command on editor that opened the dialog/popup.
</div>
<h4>Parameters</h4>
<table class="params">
<tr>
<td class="first">cmd:String</td>
<td class="last">Command to execute.</td>
</tr>
<tr>
<td class="first">ui:Boolean</td>
<td class="last">Optional boolean value if the UI for the command should be presented or not.</td>
</tr>
<tr>
<td class="first">val:Object</td>
<td class="last">Optional value to pass with the comman like an URL.</td>
</tr>
<tr>
<td class="first">a:Object</td>
<td class="last">Optional arguments object.</td>
</tr>
</table>
</div>
<div class="memberDetails" id="executeOnLoad">
<h3>executeOnLoad<span class="memberType">method</span>
</h3>
<code class="syntax">public static 
						function executeOnLoad(s:String):void</code>
<div class="memberDescription">Will executed the specified string when the page has been loaded. This function
was added for compatibility with the 2.x branch.
</div>
<h4>Parameters</h4>
<table class="params">
<tr>
<td class="first">s:String</td>
<td class="last">String to evalutate on init.</td>
</tr>
</table>
</div>
<div class="memberDetails" id="getLang">
<h3>getLang<span class="memberType">method</span>
</h3>
<code class="syntax">public static 
						function getLang(n:String, dv:String):String</code>
<div class="memberDescription">Returns a language item by key.
</div>
<h4>Parameters</h4>
<table class="params">
<tr>
<td class="first">n:String</td>
<td class="last">Language item like mydialog.something.</td>
</tr>
<tr>
<td class="first">dv:String</td>
<td class="last">Optional default value to return.</td>
</tr>
</table>
<h4>Returns</h4>
<div class="returns">String - Language value for the item like "my string" or the default value if it wasn't found.</div>
</div>
<div class="memberDetails" id="getParam">
<h3>getParam<span class="memberType">method</span>
</h3>
<code class="syntax">public static 
						function getParam(n:String, dv:String):String</code>
<div class="memberDescription">Returns a editor parameter/config option value.
</div>
<h4>Parameters</h4>
<table class="params">
<tr>
<td class="first">n:String</td>
<td class="last">Name of the editor config option to retrive.</td>
</tr>
<tr>
<td class="first">dv:String</td>
<td class="last">Optional default value to return.</td>
</tr>
</table>
<h4>Returns</h4>
<div class="returns">String - Parameter value or default value if it wasn't found.</div>
</div>
<div class="memberDetails" id="getWin">
<h3>getWin<span class="memberType">method</span>
</h3>
<code class="syntax">public static 
						function getWin():Window</code>
<div class="memberDescription">Returns the reference to the parent window that opened the dialog.
</div>
<h4>Returns</h4>
<div class="returns">Window - Reference to the parent window that opened the dialog.</div>
</div>
<div class="memberDetails" id="getWindowArg">
<h3>getWindowArg<span class="memberType">method</span>
</h3>
<code class="syntax">public static 
						function getWindowArg(n:String, dv:String):String</code>
<div class="memberDescription">Returns a window argument/parameter by name.
</div>
<h4>Parameters</h4>
<table class="params">
<tr>
<td class="first">n:String</td>
<td class="last">Name of the window argument to retrive.</td>
</tr>
<tr>
<td class="first">dv:String</td>
<td class="last">Optional default value to return.</td>
</tr>
</table>
<h4>Returns</h4>
<div class="returns">String - Argument value or default value if it wasn't found.</div>
</div>
<div class="memberDetails" id="init">
<h3>init<span class="memberType">method</span>
</h3>
<code class="syntax">public static 
						function init():void</code>
<div class="memberDescription">Initializes the popup this will be called automatically.
</div>
</div>
<div class="memberDetails" id="openBrowser">
<h3>openBrowser<span class="memberType">method</span>
</h3>
<code class="syntax">public static 
						function openBrowser(element_id:string, type:string, option:string):void</code>
<div class="memberDescription">Opens a filebrowser/imagebrowser this will set the output value from
the browser as a value on the specified element.
</div>
<h4>Parameters</h4>
<table class="params">
<tr>
<td class="first">element_id:string</td>
<td class="last">Id of the element to set value in.</td>
</tr>
<tr>
<td class="first">type:string</td>
<td class="last">Type of browser to open image/file/flash.</td>
</tr>
<tr>
<td class="first">option:string</td>
<td class="last">Option name to get the file_broswer_callback function name from.</td>
</tr>
</table>
</div>
<div class="memberDetails" id="pickColor">
<h3>pickColor<span class="memberType">method</span>
</h3>
<code class="syntax">public static 
						function pickColor(e:DOMEvent, element_id:string):void</code>
<div class="memberDescription">Executes a color picker on the specified element id. When the user
then selects a color it will be set as the value of the specified element.
</div>
<h4>Parameters</h4>
<table class="params">
<tr>
<td class="first">e:DOMEvent</td>
<td class="last">DOM event object.</td>
</tr>
<tr>
<td class="first">element_id:string</td>
<td class="last">Element id to be filled with the color value from the picker.</td>
</tr>
</table>
</div>
<div class="memberDetails" id="requireLangPack">
<h3>requireLangPack<span class="memberType">method</span>
</h3>
<code class="syntax">public static 
						function requireLangPack():void</code>
<div class="memberDescription">Loads a specific dialog language pack. If you pass in plugin_url as a arugment
when you open the window it will load the <plugin url>/langs/<code>_dlg.js lang pack file.
</div>
</div>
<div class="memberDetails" id="resizeToInnerSize">
<h3>resizeToInnerSize<span class="memberType">method</span>
</h3>
<code class="syntax">public static 
						function resizeToInnerSize():void</code>
<div class="memberDescription">Resizes the dialog to the inner size of the window. This is needed since various browsers
have different border sizes on windows.
</div>
</div>
<div class="memberDetails" id="restoreSelection">
<h3>restoreSelection<span class="memberType">method</span>
</h3>
<code class="syntax">public static 
						function restoreSelection():void</code>
<div class="memberDescription">Restores any stored selection. This can be useful since some browsers
looses it's selection if a control element is selected/focused inside the dialogs.
</div>
</div>
<div class="memberDetails last" id="storeSelection">
<h3>storeSelection<span class="memberType">method</span>
</h3>
<code class="syntax">public static 
						function storeSelection():void</code>
<div class="memberDescription">Stores the current editor selection for later restoration. This can be useful since some browsers
looses it's selection if a control element is selected/focused inside the dialogs.
</div>
</div>
</div>
<div class="details">
<h2>Event details</h2>
<div class="memberDetails last" id="onInit">
<h3>onInit<span class="memberType">event</span>
</h3>
<code class="syntax">public static 
						event onInit(editor:<a href="class_tinymce.Editor.html">Editor</a>)</code>
<div class="memberDescription">Fires when the popup is initialized.
</div>
<h4>Parameters</h4>
<table class="params">
<tr>
<td class="first">editor:<a href="class_tinymce.Editor.html">Editor</a>
</td>
<td class="last">Editor instance.</td>
</tr>
</table>
<h4>Example</h4>
<pre class="brush: js;"/>
</div>
</div>
</div>
</div>
</body>
</html>
